package level.model.utility;

import level.model.Attribute;
import level.model.Component;
import level.model.GameObject;

// Have to export these to an xml system; "crate1.xml", "goomba.xml", etc.

public class GameObjectFactory
{
	public static GameObject createGoomba(int x, int y)
	{
		GameObject g = new GameObject();
		g.setObjectName("Goomba");
		g.setIconPath("resources/sprites/goombaright3.png");
		g.setX(x);
		g.setY(y);
		g.setW(22);
		g.setH(22);
		
		Component c = new Component();
		c.setComponentName("PositionComponent");
		c.addAttribute(new Attribute("x", "" + x));
		c.addAttribute(new Attribute("y", "" + y));
		g.addComponent(c);

		c = new Component();
		c.setComponentName("DirectionComponent");
		c.addAttribute(new Attribute("Direction", "right"));
		g.addComponent(c);

		c = new Component();
		c.setComponentName("GoombaAIComponent");
		g.addComponent(c);
		
		return g;
	}
	
	public static GameObject createCrate(int x, int y)
	{
		GameObject g = new GameObject();
		g.setObjectName("Crate1");
		g.setIconPath("resources/sprites/crate1.png");
		g.setX(x);
		g.setY(y);
		g.setW(32);
		g.setH(32);
		
		Component c = new Component();
		c.setComponentName("PositionComponent");
		c.addAttribute(new Attribute("x", "" + x));
		c.addAttribute(new Attribute("y", "" + y));
		g.addComponent(c);
		
		return g;
	}
	
	public static GameObject createStartPosition(int x, int y)
	{
		GameObject g = new GameObject();
		g.setObjectName("Start");
		g.setIconPath("resources/sprites/start.png");
		g.setX(x);
		g.setY(y);
		g.setW(32);
		g.setH(32);
		
		Component c = new Component();
		c.setComponentName("PositionComponent");
		c.addAttribute(new Attribute("x", "" + x));
		c.addAttribute(new Attribute("y", "" + y));
		g.addComponent(c);
		
		return g;
	}
}
